﻿//-----------------------------------------------------------------------------
// <copyright file="Page.xaml.cs" company="William E. Kempf">
//     Copyright (c) Peter O'Hanlon.
// </copyright>
//-----------------------------------------------------------------------------

namespace SimpleSilverlight
{
    using System;
    using System.Windows.Controls;
    using Onyx.Windows;

    /// <summary>
    /// The main page.
    /// </summary>
    public partial class Page : UserControl, ITestMessage
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="Page"/> class.
        /// </summary>
        public Page()
        {
            try
            {
                InitializeComponent();
                Onyx.Command.ButtonBaseExtensions.SetCommand(this.TestButton, ((MainWindowViewModel) View.GetModel(this)).TestMessageDisplay);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }

        #region ITestMessage Members

        /// <summary>
        /// Gets the test message.
        /// </summary>
        /// <value>The test message.</value>
        public string TestMessage
        {
            get { return "Hello Silverlight"; }
        }

        #endregion
    }
}
